package cn.xiaolang.function.java_jvm;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.vm.VM;

import java.io.IOException;
import java.util.Scanner;

/**
 * <ui> jmap -dump:format=b,file=heap.bin </ui>
 * <ui> jhat heap.bin 或者用 jvisualvm 加载</ui>
 *
 * @author Dean
 * @date 2023/4/24
 */
public class JavaMarkWordSample {

    public static void main(String[] args) throws IOException {
        UserInfo user = new UserInfo("Dean");
        System.out.println(user);
        // block for analyze
        Scanner scanner = new Scanner(System.in);
        System.out.print("Waiting your command:");
        String inputText = scanner.nextLine();
        System.out.println("Got your input:" + inputText);
        scanner.close();
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    static class UserInfo {
        String name;
    }
}